﻿<?php
// +----------------------------------------------------------------------
// | Quotes [ 只为给用户更好的体验]**[我知道发出来有人会盗用,但请您留版权]
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 零度  <2109877665@qq.com>          盗用不留版权,你就不配拿去!
// +----------------------------------------------------------------------
// | Date: 2019年08月20日
// +----------------------------------------------------------------------

$title='支付云端设置';
include './Head.php';
?>
<!-- APP MAIN ==========-->
<div class="row">
			<div class="col-sm-5 col-md-5">
					<div class="block">
					<div class="panel-heading">
						<h4 class="panel-title"><span class="glyphicon glyphicon-globe"></span> 官方温馨提示</h4>
					</div>
					<div class="panel-body">
							<div class="form-group">
                                <label>PS：</label>
								<font color="red"><br>
								1.此页面,不懂禁止胡乱修改哦<br>
								<br>
								2.在线更新的速度跟服务器有关系哦
								
								</font>
					</div>
							<!--div class="form-group">
						<button type="sumbit" class="btn btn-primary btn-block" onclick="paymin_set();">确定修改</button>
								
							</div-->
				</div>
			</div>
			</div>
			
			<div class="col-sm-7 col-md-7">
					<div class="block">
					<div class="panel-heading">
						<h4 class="panel-title"><span class="glyphicon glyphicon-globe"></span> 更新设置</h4>
					</div>
					<div class="panel-body">
							<div class="form-group">
                                <label>最新版本</label>
                                <input type="text" id="ver" name="ver" value="<?=$conf['ver']?>" class="form-control">
                            </div>
							<div class="form-group">
                                <label>最新版本号</label>
                                <input type="text" id="vers" name="vers" value="<?=$conf['vers']?>" class="form-control">
                            </div>
							<div class="form-group">
                                <label>更新内容</label>
								<textarea id="uplog" name="uplog" class="form-control"><?=$conf['uplog']?></textarea>
                            </div>
							<div class="form-group">
                                <label>未授权显示内容</label>
                                <input type="text" id="content" name="content" value="<?=$conf['content']?>" class="form-control">
							</div>
							<div class="form-group">
                                <label>是否开启更新</label>
                                <select class="form-control m-b" id="is_up" name="is_up">
                                    <option value="<?=$conf['is_up']?>"><?=$conf['is_up']?></option>
                                    <option value="开启更新">开启更新</option>
                                    <option value="关闭更新">关闭更新</option>
                                </select>
					</div>
							<div class="form-group">
						<button type="sumbit" class="btn btn-primary btn-block" onclick="paytype_set();">确定修改</button>
								
							</div>
					</div>
					</div><!-- .row --> 
	<script type="text/javascript">
function paytype_set(id){//支付通道配置
        var ver= $("#ver").val();  
        var vers= $("#vers").val();
        var uplog= $("#uplog").val();
        var content= $("#content").val();
        var is_up= $("#is_up").val();
		if(ver=='' || vers=='' || uplog==''){layer.alert('请确保各项不能为空！');return false;}
		  	var ii = layer.load(3, {shade:[0.1,'#fff']});
		  	$.ajax({
				type : "POST",
				url : "Ajax.php?act=Update",
				data : {ver,vers,uplog,content,is_up},
				dataType : 'json',
				timeout:10000,
				success : function(data) {					  
					  layer.close(ii);
					  layer.msg(data.msg);
					  if(data.code==1){
						setTimeout(function () {
							location.href="./Update.php";
						}, 1000); //延时1秒跳转
					  }
				},
				error:function(data){
					layer.close(ii);
					layer.msg('服务器错误');
					}
			});
		  	
}
  </script>
